#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int a = 0;
	int cnt = 0;
	for (a = 1000; a <= 2000; a++)
	{
		if((a%4==0&&a%100!=0)||a%400==0)
		{
			cnt++;
			printf("%d ", a);

		}
		if (a / 100 == 0)
		{
			printf("\n");
		}
	}
	return 0;
}